<?php
include "connection.php";
$username=$_GET['username'];
$password=$_GET['password'];


$result=mysql_query("SELECT * FROM tusers WHERE username='$username'");

/*while ($row = mysql_fetch_object($result)) 
		{
			$response["photo"]=$row->photo;
		}
	*/	
$count=mysql_num_rows($result);
if($count==1)
{
$result1=mysql_query("UPDATE  tusers set password='$password' WHERE username='$username'");

$result2=mysql_query("SELECT * FROM tusers WHERE username='$username' and password='$password'");
$count1=mysql_num_rows($result2);
}
else
{
$count1=0;
}
if($count1==1)
{
	$response["code"]="1";
	$response["msg"] = "password change successfully";
}
else
{
	$response["code"]="0";
	$response["msg"] = "Error Occured";
}

echo json_encode($response);

?>






